package org.bioversityinternational.mgbms.model.domain;

// Generated 13 oct. 2011 12:11:05 by Hibernate Tools 3.4.0.CR1

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Parameter;

/**
 * Mtstag generated by hbm2java
 */
@Entity
@Table(name = "MTSTag", schema = "dbo", catalog = "imgbms")
public class Mtstag implements java.io.Serializable {

	private int mtsmaterialId;
	private Material material;
	private int referenceMaterialId;
	private int quantity;

	public Mtstag() {
	}

	public Mtstag(Material material, int referenceMaterialId, int quantity) {
		this.material = material;
		this.referenceMaterialId = referenceMaterialId;
		this.quantity = quantity;
	}

	@GenericGenerator(name = "generator", strategy = "foreign", parameters = @Parameter(name = "property", value = "material"))
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "MTSMaterialId", unique = true, nullable = false)
	public int getMtsmaterialId() {
		return this.mtsmaterialId;
	}

	public void setMtsmaterialId(int mtsmaterialId) {
		this.mtsmaterialId = mtsmaterialId;
	}

	@OneToOne(fetch = FetchType.LAZY)
	@PrimaryKeyJoinColumn
	public Material getMaterial() {
		return this.material;
	}

	public void setMaterial(Material material) {
		this.material = material;
	}

	@Column(name = "referenceMaterialId", nullable = false)
	public int getReferenceMaterialId() {
		return this.referenceMaterialId;
	}

	public void setReferenceMaterialId(int referenceMaterialId) {
		this.referenceMaterialId = referenceMaterialId;
	}

	@Column(name = "quantity", nullable = false)
	public int getQuantity() {
		return this.quantity;
	}

	public void setQuantity(int quantity) {
		this.quantity = quantity;
	}

}
